package avicit.cbb.techclass.tabledefine.cbbtabcolumnstl.controller.rest;


import avicit.cbb.techclass.tabledefine.cbbtabcolumnstl.controller.service.impl.CbbTabColumnsTlService;
import avicit.cbb.techclass.tabledefine.commtablemanager.action.rest.CommTableManagerRest;
import avicit.platform6.core.rest.msg.ResponseMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @金航数码科技有限责任公司
 * @作者：jiam
 * @邮箱：jiam@avic-digital.com
 * @创建时间： 2020-12-31 14:52
 * @类说明：oa_travel_rbRest
 * @修改记录：
 */
@RestController
@Api(tags = "CommTableManagerServiceRest", description = "CommTableManager_Service_Rest")
@RequestMapping("/api/CommTableManagerService/CommTableManagerServiceRest")
public class CbbTabColumnsTlServiceRest {

    private static final Logger LOGGER = LoggerFactory.getLogger(CbbTabColumnsTlServiceRest.class);


    @Autowired
    private CbbTabColumnsTlService service;

    /**
     * 多语言信息
     * @param id
     * @return
     */
    @PostMapping("/getAllLanguageById")
    @ApiOperation(value = "多语言信息")
    public ResponseMsg<List<Map<String, Object>>> getAllLanguageById(@ApiParam(value = "id", name = "id") @RequestBody String id) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        List<Map<String, Object>> allLanguageById = null;
        try {
            allLanguageById = service.getAllLanguageById(id);
            responseMsg.setResponseBody(allLanguageById);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }
}
